from typing import List


def func1(nums: List[int]) -> int:
    for i in range(1, len(nums) - 1):
        if nums[i - 1] < nums[i] and nums[i] > nums[i + 1]:
            return i


def func2(nums: List[int]) -> int:
    i, j = 0, len(nums) - 1
    while i <= j:
        pivot = i + (j - i)//2
        if nums[pivot - 1] < nums[pivot] < nums[pivot + 1]:
            i = pivot + 1
        elif nums[pivot - 1] > nums[pivot] > nums[pivot + 1]:
            j = pivot - 1
        else:
            return pivot


def func3(nums: List[int]) -> int:
    i, j = 0, len(nums) - 1
    while i < j:
        pivot = (i + j) // 2
        if nums[pivot] < nums[pivot + 1]:
            i = pivot + 1
        else:
            j = pivot
    return i


print(func3([0, 10, 8, 5, 2]))
